<?php

class AccountController extends Zend_Controller_Action
{

    public function init()
	
    {
    		
		if(!(Zend_Auth::getInstance()->hasIdentity())){
					
					$this->_helper->flashMessenger->addMessage('Please enter your login details to enter the student module');
					$this->_redirect('default/users/login');
				}		
        /* Initialize action controller here */
		
		
			
			
		//Setting up community navigation
		
		$config2 = new Zend_Config_Xml(APPLICATION_PATH . '/configs/membernav.xml', 'nav');
		$navigation2 = new Zend_Navigation($config2);
		$this->view->navigation($navigation2);
		
	
    }

    public function indexAction()
    {
    	
    			
			//Getting the authentication variable
	
	 $auth = Zend_Auth::getInstance()->getIdentity();
			
				$this->view->layout()->setlayout('members');
			
				$fname =  $auth->fname;
				$lname =  $auth->lname;
				$id = $auth->id;
				$this->view->message = "$fname  $lname";
			
    }

    
    }


